#ifndef __PAGELIB_H
#define __PAGELIB_H
#include "Mylogger.hh"
#include "PagePreprocess/DirScanner.h"
#include "PagePreprocess/tinyxml2.h"
#include "PagePreprocess/FileProcessor.h"
#include <string>
#include <iostream>
#include <sstream>
#include <vector> 
#include <map>
#include <fstream>
using std::vector;
using std::pair;
using std::map;
using std::string;
using std::ifstream;
using std::ofstream;
using std::ostringstream;
using std::cout;
using tinyxml2::XMLDocument;
 
class PageLib
{
public:
    PageLib(DirScanner & dirs,FileProcessor &fileproc);
    void create();
private:
    void store_ripepage(const vector<WebPage>& web);
    void store_offsetLib();
private:
    DirScanner & _dirScanner;   //目录扫描对象的引用
    FileProcessor & _fileproc;  //xml文件处理器
    map<int,pair<int,int>> _offsetLib;  //存放每篇文档在网页库的位置信息<id,<起始位置，长度>>
};
 
#endif  